package cn.rongdao.jrkabao.ui.main.mainfragment.personal;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.mifengkong.frtools.util.FRImageLoad;

import cn.rongdao.jrkabao.R;
import cn.rongdao.jrkabao.bean.main.personal.PersonItemInfoBean;

/**
 * Created by jack on 17/5/10
 */

public class PersonItemInfoUIComponent extends RelativeLayout {
    public PersonItemInfoUIComponent(Context context) {
        super(context);
    }

    public PersonItemInfoUIComponent(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public PersonItemInfoUIComponent(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    private ImageView ivAvatar;
    private PersonInfoUIComponent personInfoUIComponent;

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();
        ivAvatar = findViewById(R.id.ip_iv_avatar);
        personInfoUIComponent = findViewById(R.id.ip_person_info);
    }

    public void setContent(PersonItemInfoBean data) {
        FRImageLoad.loadImage(data.getLogo(), ivAvatar);
        personInfoUIComponent.setContent(data);
    }
}